<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title></title>
    <style>
      .box {
        height: 100px;
        margin-bottom: 20px;
      }
      .box1 {
        background-color: red;
      }
      .box2 {
        background-color: green;
      }
      .box3 {
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="box box1" @mousedown="printMsg('box1 mousedown')"></div>
      <div class="box box2" @mousedown="printMsg('box2 mousedown')"></div>
      <div class="box box3" @mousedown="printMsg('box3 mousedown')"></div>
      <div
        class="box box1"
        @mousedown.left="printMsg('box1 mousedown left')"
      ></div>
      <div
        class="box box2"
        @mousedown.right="printMsg('box2 mousedown right')"
      ></div>
      <div
        class="box box3"
        @mousedown.middle="printMsg('box3 mousedown middle')"
      ></div>
    </div>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

    <script>
      const { createApp, ref } = Vue;

      const app = createApp({
        setup() {
          function printMsg(...args) {
            console.log(args);
          }

          return {
            printMsg,
          };
        },
      });

      app.mount("#app");
    </script>
  </body>
</html>
